package router

import (
	"github.com/gin-gonic/gin"
	"go-admin-template/config"
	"go-admin-template/router/api"
)

//Router 配置路由
func Router() *gin.Engine {

	engine := gin.Default()

	// 设置运行模式
	gin.SetMode(config.Info.Run.Mode)

	userGroup := engine.Group("/user")
	userGroup.POST("/add", api.AddUser)
	userGroup.GET("/list", api.UserList)

	return engine
}
